import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

// 客户订单页查询
export const getOrders = params => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders`, { params });

// 新增客户订单
export const addOrders = params => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders`, params);

// 修改客户订单
export const modifyOrders = params => axios.put(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders`, params);

// 查询车辆列表
export const quyvehicle = (id, params) => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/${id}/vehicleList`, { params });



// 根据id查询客户订单
export const quyOrders = (id, params) => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/${id}`, { params });

// 撤回客户订单
export const withdrawOrders = (id, params) => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/withdraw/${id}`, { params });

// 提交客户订单
export const subOrders = (id, params) => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/submit/${id}`, params );

// 作废客户订单(逻辑删除)
export const toVOrders = (id, params) => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/nullify/${id}`, params );

// 删除客户订单(物理删除)
export const deleteOrders = (id, params) => axios.post(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/delete/${id}`, params );

// 查询客户订单审核记录
export const auditRecords = (id, params) => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/customerOrders/soAudit/${id}`, { params });

// 根据id查询销售订单--PC
export const salesOrders = (id, params) => axios.get(`${SERVER.CYXDMS_RETAIL}/ordermanage/salesOrders/${id}`, params );

// 选择线索(客户)
export const selectionClues = params => axios.get(`${SERVER.CYXDMS_CLUE}/potenCus/queryPotentialForOrder`, { params } );

// 获取销售顾问列表 re:getUsersByPosition
// export const getSalesConsultant = params => axios.get(`${SERVER.CYXDMS_CLUE}/clue/employeeList`, { params } );
// let params = {
//   positionCodes: [10061015],
//   menuId: 223001
// }
// 获得当前用户可操作的人员
export const getUsersByPosition = params => axios.get(`${SERVER.SYSMANAGE}/basedata/users/getUsersByPosition`, { params } );
// 车辆主数据查询
export const vehicleDataQuery = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/vehicleProduct/productInfo`, { params } );
// 开票人信息添加潜客
export const addCustomerOne = params => axios.put(`${SERVER.CYXDMS_CLUE}/potenCus/addCustomerOne`, params );
// 开票人信息删除潜客
export const deleteCustomerOne = params => axios.get(`${SERVER.CYXDMS_CLUE}/potenCus/deleteCustomerOne`, { params } );
// 开票人信息查询潜客
export const queryCustomerOne = params => axios.get(`${SERVER.CYXDMS_CLUE}/potenCus/queryCustomerOne`, { params } );
// potenCus/updateCustomerOne 开票人信息修改潜客
export const updateCustomerOne = params => axios.put(`${SERVER.CYXDMS_CLUE}/potenCus/updateCustomerOne`, params );
